home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2600 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mudskipper.cac.psu.edu!user
  2. From: fcusack@tdx.org (frank.)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: *Pointer to Functions();   /* HELP */
  5. Date: Mon, 22 Jan 1996 11:38:31 -0400
  6. Organization: Penn State University, Center for Academic Computing
  7. Message-ID: <fcusack-2201961138310001@mudskipper.cac.psu.edu>
  8. References: <4dvrq8$c2c@news.unicomp.net>
  9. NNTP-Posting-Host: mudskipper.cac.psu.edu
  10.  
  11. In article <4dvrq8$c2c@news.unicomp.net>, jgore@conline.com (Jerry_Gore) wrote:
  12.  
  13. > How do I pass a pointer to a funtion?
  14. > The following is found in a program:
  15. >     #define WORD    unsigned int       
  16. >     void    InstallTimer0(WORD period,void far (*func)(void));
  17. > My function is thus:
  18. >     void far animate(void)    /* I added 'far' for no good reason.   */
  19. >     {                         /* It uses that name in InstallTimer0. */ 
  20. >     /* do what ever */        
  21. >     return;
  22. >     }
  23. > How do I send InstallTimer0 the pointer to my function animate ???
  24. > I tried:
  25. >      InstallTimer0(120 , (*animate)());
  26.  
  27. try InstallTimer0(120, &animate);
  28.  
  29. > But of course, this does not work and neither did anything else!
  30. > What do I do ???
  31. ~Frank
  32.  -- I am Pentium of Borg.  Division is futile.  You will be approximated. --
  33.  --   If you build it, they will come --> http://www.tdx.org/~fcusack/    --
  34.  -- PGP key fingerprint: 01 C0 C0 B9 CC 78 67 0F  3F 64 80 65 8B 0F F9 EA --
  35.